﻿@model PageDataVM<List<StudentEvalCourse>>
@{
    ViewData["Title"] = "学生评价页面";
}
@section Css{
<link rel="stylesheet" href="~/css/student.css" asp-append-version="true"/>
}

<div class="content">
    <h2>当前共有 @Model.Data.Count 个学生对您做了评价：</h2>
    <div class="content-table">
        <table class="table table-striped table-hover">
            <thead>
                <tr>
                    <th scope="col">#</th>
                    <th scope="col">学生编号</th>
                    <th scope="col">学生名</th>
                    <th scope="col">评价课程</th>
                    <th scope="col">分数</th>
                    <th scope="col">操作</th>
                </tr>
            </thead>
            <tbody>
                @{
                    int i = 1;
                    foreach (var item in Model!.Data)
                    {
                        <tr>
                            <th scope="row">@i</th>
                            <td>@item.Student!.Number</td>
                            <td>@item.Student!.Name</td>
                            <td>@item.TeacherWithCourses!.Course!.Name</td>
                            <td>
                                @{
                                    if (!item.Score.HasValue)
                                    {
                                        @Html.Raw("未评分")
                                    }
                                    else
                                    {
                                        @item.Score
                                    }
                                }

                            </td>
                            <td>
                                <a class="btn btn-outline-secondary btn-sm" asp-action="Result" asp-controller="Teacher" asp-route-scid="@item.ScId" asp-route-sid="@item.StudentId" >查看评分细节</a>
                            </td>
                        </tr>
                        i++;
                    }
                }
            </tbody>
        </table>
        
        @await Html.PartialAsync("Pagniation")
        <div style="width: 100%;height:10px;"></div>
    </div>

</div>

@section Scripts{
<script src="~/lib/angular/angular.js"></script>
<script src="~/js/teacher.js" asp-append-version="true"></script>
}